package com.ruoyi.video.service;

import com.ruoyi.common.support.Convert;
import com.ruoyi.video.domain.TeacherInfo;
import com.ruoyi.video.mapper.TeacherInfoMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 讲师 服务层实现
 *
 * @author pig13
 * @date 2018-11-11
 */
@Service("teacherInfoService")
public class TeacherInfoServiceImpl implements TeacherInfoService {
    @Autowired
    private TeacherInfoMapper teacherInfoMapper;

    /**
     * 查询讲师信息
     *
     * @param id 讲师ID
     * @return 讲师信息
     */
    @Override
    public TeacherInfo selectTeacherInfoById(Integer id) {
        return teacherInfoMapper.selectTeacherInfoById(id);
    }

    /**
     * 查询讲师列表
     *
     * @param teacherInfo 讲师信息
     * @return 讲师集合
     */
    @Override
    public List<TeacherInfo> selectTeacherInfoList(TeacherInfo teacherInfo) {
        return teacherInfoMapper.selectTeacherInfoList(teacherInfo);
    }

    /**
     * 查询讲师列表
     *
     * @param alias 讲师信息
     * @return 讲师集合
     */
    @Override
    public List<TeacherInfo> selectTeacherInfoBriefList(String alias) {
        return teacherInfoMapper.selectTeacherInfoBriefList(alias);
    }


    /**
     * 新增讲师
     *
     * @param teacherInfo 讲师信息
     * @return 结果
     */
    @Override
    public int insertTeacherInfo(TeacherInfo teacherInfo) {
        return teacherInfoMapper.insertTeacherInfo(teacherInfo);
    }

    /**
     * 修改讲师
     *
     * @param teacherInfo 讲师信息
     * @return 结果
     */
    @Override
    public int updateTeacherInfo(TeacherInfo teacherInfo) {
        return teacherInfoMapper.updateTeacherInfo(teacherInfo);
    }

    /**
     * 删除讲师对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteTeacherInfoByIds(String ids) {
        return teacherInfoMapper.deleteTeacherInfoByIds(Convert.toStrArray(ids));
    }

}
